﻿@page "/Console/Index"

<table class="table">
    <thead>
        <tr>
            <th>交易名称</th>
            <th>执行耗时</th>
            <th>总执行</th>
            <th>总耗时</th>
            <th>成功执行(平均耗时)</th>
            <th>失败执行(平均耗时)</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var execInfo in FunConsole.TransExecInfos.OrderByDescending(execInfo => execInfo.TotalNumber))
        {
            <tr>
                <td>@execInfo.Name</td>
                <td>@($"{(execInfo.Elapsed).Round()}毫秒")</td>
                <td>@($"{execInfo.TotalNumber}次")</td>
                <td>@($"{(execInfo.TotalTime / 1000 / 60).Round(2)}分钟")</td>
                <td>@($"{execInfo.Success}次({(execInfo.Success.IsZero() ? 0 : execInfo.SuccessTime / execInfo.Success).Round()}毫秒)")</td>
                <td title=@execInfo.FailMsg>@($"{execInfo.Fail}次({(execInfo.Fail.IsZero() ? 0 : execInfo.FailTime / execInfo.Fail).Round()}毫秒)")</td>
            </tr>
        }
    </tbody>
</table>

@code {

}